from PyQt5 import QtCore, QtGui, QtWidgets


# 提供判断用户输入是否中断输入的基本功能
class BaseInputDialog(QtWidgets.QDialog):
    def __init__(self):
        super().__init__()
        # 用于标记提交和关闭
        self.submit_flag = False

    def submit_slot(self):
        # 用户提交
        self.submit_flag = True
        self.close()

    def closeEvent(self, event: QtGui.QCloseEvent):
        # 用户中断
        if self.submit_flag:
            self.accept()
        else:
            self.reject()

    def get_input(self):
        return
